create_stream rustdoc Errors omits InvalidRate#953
Conversation
|
heads up: main's ci was broken (the Backend CI and Backend Docker Image CI jobs) until the fixes in #969 and #974 just landed, so the red backend/docker checks on this pr are almost certainly stale, they ran against the broken main. please rebase to re-test against the now-green main: |
2429fdf to
894cff7
Compare
|
@ogazboiz Kindly check now boss |
ogazboiz
left a comment
There was a problem hiding this comment.
verified: create_stream computes rate_per_second = net_amount/duration and returns InvalidRate when it's 0 (lib.rs:216), so documenting InvalidRate on create_stream is accurate. doc-only one line. merging.
docs: Add InvalidRate to create_stream # Errors list
closes #797
This PR addresses a documentation inconsistency in the
create_streamfunction. The function can returnStreamError::InvalidRatewhen the calculated rate per second truncates to zero, but this error was missing from the function's doc comment in the# Errorssection.This change updates the documentation to include
InvalidRate, ensuring that developers are aware of all possible error conditions when using the function.Why this matters
The
# Errorssection forcreate_streamwas out of sync with the implementation. It was missing theInvalidRateerror, which can occur whennet_amount / durationtruncates to 0. Accurate documentation is crucial for contract usability and helps prevent integration errors.Acceptance Criteria
InvalidRateerror is added to the# Errorslist in thecreate_streamfunction's doc comment incontracts/stream_contract/src/lib.rs.Out of Scope
# Errorssections for any other functions.